import * as THREE from 'three';

/**
 * 地板类
 */
export default class Floor {
    constructor(_scene, _cargo) {
        console.log('地板类')

        this.parent = _scene;
      
        this.createFloor(_cargo); // 生成地板
    }
    createFloor (_cargo) {
        let texture = _cargo['warehouse/floor'];
        texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
        texture.repeat.set(10, 10);
        var floorGeometry = new THREE.BoxGeometry(600, 400,-2);
        var floorMaterial = new THREE.MeshBasicMaterial({
          map: texture,
        });
        var floor = new THREE.Mesh(floorGeometry, floorMaterial);
        floor.rotation.x = -Math.PI / 2;
        floor.name = "地面";
        floor.position.set(0,0,0);
        this.parent.add(floor);
    };
  
    ///////////////////////////// 公共方法 /////////////////////////////
   
    update (_props) {
       
    };
    // On Window Resize
    onWindowResize (vpW, vpH, pixelRatio) {
        
    };
}